<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>${seo_title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<meta name="keywords" content="${seo_keywords}"></meta>
<meta name="description" content="${seo_description}"></meta>
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function submitdata(){
	var name=document.getElementById('name').value;
	var loginName=document.getElementById('loginName').value;
	var password=document.getElementById('password').value;
	var rpassword=document.getElementById('rpassword').value;
	var birthday=document.getElementById('birthday').value;
	var msn=document.getElementById('msn').value;
	if(name==''||loginName==''||password==''||rpassword==''||password.length<6||rpassword.length<6){
		alert('姓名、用户名、密码不能为空；且密码长度应为6位或6位以上');
		return false;
	}
	if(!(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(loginName))){
		alert('邮箱地址格式错误，形如exaple0089_9-9.aBs@gmail.com');
		return false;
	}
	if(password!=rpassword){
		alert('确认密码不正确，请重新输入密码');
		document.getElementById('password').value='';
		document.getElementById('rpassword').value='';
		return false;
	}
	if(birthday!=''&&!(/^(19|20)([0-9]{2,2})-(01|02|03|04|05|06|07|08|09|10|11|12)-([0-3]{1,1}[0-9]{1,1})$/.test(birthday))){
		alert('生日格式不对，请用1985-02-01这样的格式填写');
		return false;
	}
	if(msn!=''&&!(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(msn))){
		alert('msn填写错误，形如exaple0089_9-9.aBs@gmail.com');
		return false;
	}
	document.getElementById('f').submit();
	
}
//-->
</script>
</head>
<body>
	<%@ include file="header.jsp" %>
	<div id="main">
		<c:if test="${register eq 1}">
			<div>
				注册成功，自动跳转到AdPython首页，谢谢您的关注与支持。
				<script type="text/javascript">
					setTimeout("window.location.href='/'",5000);
				</script>
			</div>
		</c:if>
		<c:if test="${register ne 1}">
			<div class="register">
				<form id="f" name="f" method="post" action="/user.htm?method=register">
					<table id="register_table" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" width="100%">
						<tbody>
							<tr class="line_tr">
								<td valign="top" colspan="2">
									<span class="register_welcome">
										注册成为AdPython会员
									</span>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" colspan="2">
									<span class="register_title">
										基本信息
									</span>
									<span>（必填）</span>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap" width="70px;">
									<span class="register_lable">
										姓名：
									</span>
								</td>
								<td>
									<div>
										<input type="text" id="name" name="name" value="" size="30"/>
									</div>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										用户名：
									</span>
								</td>
								<td nowrap="nowrap">
									<p><input type="text" id="loginName" name="loginName" value="" size="30"/></p>
									<p class="p_explan"><span class="register_explan">请使用有效的邮箱地址</span></p>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										密码：
									</span>
								</td>
								<td nowrap="nowrap">
									<p><input type="password" id="password" name="password" value="" size="30"/></p>
									<p class="p_explan"><span class="register_explan">至少输入6位数字、字母组合的密码</span></p>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										确认密码：
									</span>
								</td>
								<td nowrap="nowrap">
									<input type="password" id="rpassword" name="rpassword" value="" size="30"/>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" colspan="2">
									<span class="register_title">
										详细信息
									</span>
									<span>（选填）</span>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										城市：
									</span>
								</td>
								<td nowrap="nowrap">
									<input type="text" id="city" name="city" value="" size="30"/>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										性别：
									</span>
								</td>
								<td nowrap="nowrap">
									<select id="sex" name="sex" style="width: 224px;">
										<option value=""></option>
										<option value="male">男</option>
										<option value="female">女</option>
									</select>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										生日：
									</span>
								</td>
								<td nowrap="nowrap">
									<input type="text" id="birthday" name="birthday" value="" size="30"/>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										电话：
									</span>
								</td>
								<td nowrap="nowrap">
									<input type="text" id="phone" name="phone" value="" size="30"/>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										QQ：
									</span>
								</td>
								<td nowrap="nowrap">
									<input type="text" id="qq" name="qq" value="" size="30"/>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										MSN：
									</span>
								</td>
								<td nowrap="nowrap">
									<input type="text" id="msn" name="msn" value="" size="30"/>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" nowrap="nowrap">
									<span class="register_lable">
										地址：
									</span>
								</td>
								<td nowrap="nowrap">
									<input type="text" id="address" name="address" value="" size="30"/>
								</td>
							</tr>
							<tr class="line_tr">
								<td valign="top" colspan="2">
									<div class="submit_btn">
										<input type="button" onclick="submitdata();" value="提交注册信息"/>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</form>
			</div>
		</c:if>
	</div>
	<%@ include file="footer.jsp" %>
</body>
</html>